﻿using System;
using System.Collections.Generic;
using System.Text;
using BaseHelper.Base;
using BaseHelper.Net;
using DeviceSDK.Park.Haikang;

namespace DeviceSDK.Park
{
    public class ParkAutoHelper
    {
        public static int ScaleWidth = 2000;
        public static int ScaleHeight = 1200;
        private static bool IsInit = false;

        public string Error="";


        public static string Get_Error(string FirmModelIDName, int err)
        {
            if (FirmModelIDName == "HAIKANG_TCR400")
            {
                return HaiKang_TCR400.Get_Error(err);
            }
            else
                return "设备型号不支持！";
            
        }

        public static bool IsConnected(string FirmModelIDName, string IP)
        {
            if (FirmModelIDName == "HAIKANG_TCR400")
            {
                return HaiKang_TCR400.IsConnected(IP);
            }
            else
                return false;
        }

        public static void Init()
        {
            if (!IsInit)
            {
                HaiKang_TCR400.Init();
                IsInit = true;
            }
          
        }


        public static int Get_Status(string FirmModelIDName, string IP)
        {
            return PingHelper.Get_Status(IP) ? 0 : 1;
        }


        public static int Set_Listen(string FirmModelIDName, string IP,string Port)
        {

            int ret = -1;
            if (FirmModelIDName == "HAIKANG_TCR400")
            {
                return HaiKang_TCR400.Set_Listen(IP, Port);
            }
            else
            {
                ret = 1;
            }

            return ret;
        }


        public static int Set_Connect(string FirmModelIDName, string IP, string Port,string User,string Pass)
        {

            int ret = -1;
            if (FirmModelIDName == "HAIKANG_TCR400")
            {
                return HaiKang_TCR400.Set_Connect(IP, Port,User,Pass);
            }
            else
            {
                ret = 1;
            }

            return ret;
        }

 
        //设备-关闭数据
        public static int Set_Close()
        {
            HaiKang_TCR400.Set_Close();

            return 0;
        }
        public static int Set_Close(string FirmModelIDName)
        {
            if (FirmModelIDName == "HAIKANG_TCR400")
            {
                HaiKang_TCR400.Set_Close();
            }
            else
            {
                return 1;
            }
            return 0;
        }


    }
}
